<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人中心 - 学知题库</title>
    <link href="../assets/css/app.css" rel="stylesheet">
    <link href="../assets/css/font-awesome.min.css" rel="stylesheet">
    <script src="../assets/js/chart.umd.min.js"></script>
    
    <!-- Tailwind 配置 - 已合并到公共配置文件 -->
    <!-- 
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#36CBCB',
                        accent: '#FF7D00',
                        neutral: '#F5F7FA',
                        'neutral-dark': '#4E5969',
                        success: '#00B42A',
                        warning: '#FF7D00',
                        danger: '#F53F3F',
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    -->
    
    <!-- 工具类样式 - 已合并到 src/input.css -->
    <!-- 
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .scrollbar-hide {
                -ms-overflow-style: none;
                scrollbar-width: none;
            }
            .scrollbar-hide::-webkit-scrollbar {
                display: none;
            }
            .text-shadow {
                text-shadow: 0 2px 4px rgba(0,0,0,0.1);
            }
            .card-hover {
                transition: all 0.3s ease;
            }
            .card-hover:hover {
                transform: translateY(-5px);
                box-shadow: 0 10px 20px rgba(0,0,0,0.08);
            }
            .bg-gradient-primary {
                background: linear-gradient(135deg, #165DFF 0%, #0E42B3 100%);
            }
            .progress-ring-circle {
                transition: stroke-dashoffset 0.35s;
                transform: rotate(-90deg);
                transform-origin: 50% 50%;
            }
            .animate-float {
                animation: float 3s ease-in-out infinite;
            }
            @keyframes float {
                0% { transform: translateY(0px); }
                50% { transform: translateY(-10px); }
                100% { transform: translateY(0px); }
            }
        }
    </style>
    -->
</head>
<body class="bg-gray-50 font-inter text-gray-800 min-h-screen flex flex-col">
    <!-- 顶部导航栏（登录后状态调整） -->
    <header class="bg-white shadow-sm sticky top-0 z-50 transition-all duration-300">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between">
            <div class="flex items-center space-x-2">
                <a href="#" class="flex items-center">
                    <i class="fa fa-graduation-cap text-primary text-2xl mr-2"></i>
                    <h1 class="text-xl font-bold text-gray-800">学知题库</h1>
                </a>
            </div>
            
            <div class="hidden md:flex items-center space-x-6">
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">首页</a>
                <a href="#" class="text-primary font-medium border-b-2 border-primary pb-1">题库</a>
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">学习路径</a>
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">模拟考试</a>
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">关于我们</a>
            </div>
            
            <div class="flex items-center space-x-4">
                <div class="relative hidden md:block">
                    <input type="text" placeholder="搜索题目、知识点或教材..." 
                           class="pl-10 pr-4 py-2 rounded-full bg-gray-100 focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all w-64">
                    <i class="fa fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
                </div>
                
                <!-- 登录后显示用户信息 -->
                <div class="relative group">
                    <button class="flex items-center space-x-2 focus:outline-none">
                        <img src="https://picsum.photos/id/64/40/40" alt="用户头像" 
                             class="w-8 h-8 rounded-full object-cover border-2 border-transparent hover:border-primary transition-all">
                        <span class="hidden md:inline font-medium">李明同学</span>
                        <i class="fa fa-angle-down text-gray-500"></i>
                    </button>
                    <!-- 用户下拉菜单 -->
                    <div class="absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg border border-gray-100 py-2 z-50 invisible opacity-0 group-hover:visible group-hover:opacity-100 transition-all duration-200">
                        <a href="#" class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-primary/5 hover:text-primary">
                            <i class="fa fa-user-circle mr-2"></i> 个人中心
                        </a>
                        <a href="#" class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-primary/5 hover:text-primary">
                            <i class="fa fa-cog mr-2"></i> 账号设置
                        </a>
                        <a href="#" class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-primary/5 hover:text-primary">
                            <i class="fa fa-history mr-2"></i> 学习记录
                        </a>
                        <div class="border-t border-gray-100 my-1"></div>
                        <a href="#" class="flex items-center px-4 py-2 text-sm text-danger hover:bg-danger/5">
                            <i class="fa fa-sign-out mr-2"></i> 退出登录
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </header>

    <!-- 主内容区（个人信息页面） -->
    <main class="flex-1 py-8 bg-gray-50">
        <div class="container mx-auto px-4">
            <!-- 页面标题 -->
            <div class="mb-8">
                <h2 class="text-2xl font-bold text-gray-800">个人中心</h2>
                <p class="text-gray-500 mt-1">管理您的个人信息和学习数据</p>
            </div>
            
            <!-- 个人信息主布局：左侧侧边栏 + 右侧内容区 -->
            <div class="flex flex-col lg:flex-row gap-6">
                <!-- 左侧侧边栏 -->
                <div class="lg:w-1/4 space-y-6">
                    <!-- 个人资料卡片 -->
                    <div class="bg-white rounded-xl shadow-sm overflow-hidden card-hover">
                        <div class="bg-gradient-primary h-24 relative">
                            <!-- 背景装饰 -->
                            <div class="absolute -bottom-12 left-6">
                                <img src="https://picsum.photos/id/64/100/100" alt="用户头像" 
                                     class="w-24 h-24 rounded-full border-4 border-white object-cover">
                            </div>
                        </div>
                        <div class="pt-14 px-6 pb-6">
                            <div class="mb-4">
                                <h3 class="font-bold text-lg">李明同学</h3>
                                <p class="text-sm text-gray-500">高中一年级 | 高一(3)班</p>
                            </div>
                            <div class="flex justify-between text-sm">
                                <div class="text-center">
                                    <div class="font-bold text-primary">42</div>
                                    <div class="text-gray-500">已做题目</div>
                                </div>
                                <div class="text-center">
                                    <div class="font-bold text-primary">85%</div>
                                    <div class="text-gray-500">正确率</div>
                                </div>
                                <div class="text-center">
                                    <div class="font-bold text-primary">3</div>
                                    <div class="text-gray-500">学习天数</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 侧边导航 -->
                    <div class="bg-white rounded-xl shadow-sm overflow-hidden">
                        <div class="p-4 border-b border-gray-100">
                            <h3 class="font-medium text-gray-800">个人中心导航</h3>
                        </div>
                        <ul>
                            <li>
                                <a href="#" class="flex items-center px-6 py-3 text-primary bg-primary/5 border-l-4 border-primary">
                                    <i class="fa fa-user-circle w-5 text-center mr-3"></i>
                                    <span>基本信息</span>
                                </a>
                            </li>
                            <li>
                                <a href="#" class="flex items-center px-6 py-3 text-gray-600 hover:bg-gray-50 transition-colors">
                                    <i class="fa fa-book w-5 text-center mr-3"></i>
                                    <span>学习记录</span>
                                </a>
                            </li>
                            <li>
                                <a href="#" class="flex items-center px-6 py-3 text-gray-600 hover:bg-gray-50 transition-colors">
                                    <i class="fa fa-line-chart w-5 text-center mr-3"></i>
                                    <span>学习报告</span>
                                </a>
                            </li>
                            <li>
                                <a href="#" class="flex items-center px-6 py-3 text-gray-600 hover:bg-gray-50 transition-colors">
                                    <i class="fa fa-star w-5 text-center mr-3"></i>
                                    <span>收藏题目</span>
                                </a>
                            </li>
                            <li>
                                <a href="#" class="flex items-center px-6 py-3 text-gray-600 hover:bg-gray-50 transition-colors">
                                    <i class="fa fa-cog w-5 text-center mr-3"></i>
                                    <span>账号设置</span>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
                
                <!-- 右侧内容区 -->
                <div class="lg:w-3/4 space-y-6">
                    <!-- 基本信息表单 -->
                    <div class="bg-white rounded-xl shadow-sm p-6">
                        <h3 class="font-bold text-lg mb-5 flex items-center">
                            <i class="fa fa-user-circle text-primary mr-2"></i>基本信息
                        </h3>
                        
                        <form class="space-y-6">
                            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">姓名</label>
                                    <input type="text" value="李明" 
                                           class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/30 focus:border-primary outline-none transition-colors">
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">性别</label>
                                    <div class="flex items-center space-x-4 pt-2">
                                        <label class="inline-flex items-center">
                                            <input type="radio" name="gender" checked class="text-primary focus:ring-primary">
                                            <span class="ml-2 text-gray-700">男</span>
                                        </label>
                                        <label class="inline-flex items-center">
                                            <input type="radio" name="gender" class="text-primary focus:ring-primary">
                                            <span class="ml-2 text-gray-700">女</span>
                                        </label>
                                    </div>
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">年级</label>
                                    <select class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/30 focus:border-primary outline-none transition-colors">
                                        <option>高中一年级</option>
                                        <option>高中二年级</option>
                                        <option>高中三年级</option>
                                    </select>
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">班级</label>
                                    <input type="text" value="高一(3)班" 
                                           class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/30 focus:border-primary outline-none transition-colors">
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">手机号码</label>
                                    <input type="tel" value="138****5678" 
                                           class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/30 focus:border-primary outline-none transition-colors">
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-1">电子邮箱</label>
                                    <input type="email" value="liming***@school.com" 
                                           class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/30 focus:border-primary outline-none transition-colors">
                                </div>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">个人简介</label>
                                <textarea rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/30 focus:border-primary outline-none transition-colors"
                                          placeholder="简单介绍一下自己吧...">喜欢数学和物理，希望通过学知题库提升成绩！</textarea>
                            </div>
                            
                            <div class="flex justify-end">
                                <button type="button" class="px-4 py-2 mr-3 text-gray-600 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors">
                                    取消
                                </button>
                                <button type="button" class="px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors">
                                    保存修改
                                </button>
                            </div>
                        </form>
                    </div>
                    
                    <!-- 最近学习数据 -->
                    <div class="bg-white rounded-xl shadow-sm p-6">
                        <h3 class="font-bold text-lg mb-5 flex items-center">
                            <i class="fa fa-fire text-primary mr-2"></i>最近学习数据
                        </h3>
                        
                        <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
                            <div class="p-4 border border-gray-100 rounded-lg card-hover">
                                <div class="flex items-center justify-between mb-2">
                                    <span class="text-gray-500 text-sm">今日做题</span>
                                    <i class="fa fa-check-circle text-success"></i>
                                </div>
                                <div class="flex items-end">
                                    <span class="text-2xl font-bold">12</span>
                                    <span class="text-success text-sm ml-2 mb-1">+3 较昨日</span>
                                </div>
                            </div>
                            <div class="p-4 border border-gray-100 rounded-lg card-hover">
                                <div class="flex items-center justify-between mb-2">
                                    <span class="text-gray-500 text-sm">本周正确率</span>
                                    <i class="fa fa-line-chart text-primary"></i>
                                </div>
                                <div class="flex items-end">
                                    <span class="text-2xl font-bold">82%</span>
                                    <span class="text-success text-sm ml-2 mb-1">+5% 较上周</span>
                                </div>
                            </div>
                            <div class="p-4 border border-gray-100 rounded-lg card-hover">
                                <div class="flex items-center justify-between mb-2">
                                    <span class="text-gray-500 text-sm">学习时长</span>
                                    <i class="fa fa-clock-o text-accent"></i>
                                </div>
                                <div class="flex items-end">
                                    <span class="text-2xl font-bold">1.5h</span>
                                    <span class="text-danger text-sm ml-2 mb-1">-0.3h 较昨日</span>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 学习趋势图表 -->
                        <div>
                            <h4 class="font-medium text-gray-800 mb-3">近7天做题数量趋势</h4>
                            <div class="h-64">
                                <canvas id="studyTrendChart"></canvas>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <!-- 页脚（沿用原有风格） -->
    <footer class="bg-gray-800 text-white py-12 mt-12">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <div class="flex items-center mb-4">
                        <i class="fa fa-graduation-cap text-primary text-2xl mr-2"></i>
                        <h3 class="text-xl font-bold">学知题库</h3>
                    </div>
                    <p class="text-gray-400 mb-4">智能教育资源平台，助力学生高效学习</p>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-weibo"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-wechat"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-qq"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-github"></i>
                        </a>
                    </div>
                </div>
                
                <div>
                    <h4 class="text-lg font-medium mb-4">快速链接</h4>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">首页</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">题库</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">学习路径</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">模拟考试</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">关于我们</a></li>
                    </ul>
                </div>
                
                <div>
                    <h4 class="text-lg font-medium mb-4">帮助中心</h4>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">常见问题</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">使用指南</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">意见反馈</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">联系我们</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">隐私政策</a></li>
                    </ul>
                </div>
                
                <div>
                    <h4 class="text-lg font-medium mb-4">联系我们</h4>
                    <ul class="space-y-2">
                        <li class="flex items-center">
                            <i class="fa fa-map-marker text-primary mr-2"></i>
                            <span class="text-gray-400">北京市海淀区中关村大街1号</span>
                        </li>
                        <li class="flex items-center">
                            <i class="fa fa-phone text-primary mr-2"></i>
                            <span class="text-gray-400">400-123-4567</span>
                        </li>
                        <li class="flex items-center">
                            <i class="fa fa-envelope text-primary mr-2"></i>
                            <span class="text-gray-400">contact@xuezhi.com</span>
                        </li>
                        <li class="flex items-center">
                            <i class="fa fa-clock-o text-primary mr-2"></i>
                            <span class="text-gray-400">周一至周日 9:00-21:00</span>
                        </li>
                    </ul>
                </div>
            </div>
            
            <div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400">
                <p>&copy; 2025 学知题库 版权所有 | 京ICP备12345678号</p>
            </div>
        </div>
    </footer>

    <!-- 图表初始化脚本 -->
    <script>
        // 学习趋势图表
        document.addEventListener('DOMContentLoaded', function() {
            const ctx = document.getElementById('studyTrendChart').getContext('2d');
            new Chart(ctx, {
                type: 'line',
                data: {
                    labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
                    datasets: [{
                        label: '做题数量',
                        data: [8, 15, 10, 18, 12, 20, 12],
                        borderColor: '#165DFF',
                        backgroundColor: 'rgba(22, 93, 255, 0.1)',
                        tension: 0.4,
                        fill: true,
                        pointBackgroundColor: '#FFFFFF',
                        pointBorderColor: '#165DFF',
                        pointBorderWidth: 2,
                        pointRadius: 4,
                        pointHoverRadius: 6
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            display: false
                        },
                        tooltip: {
                            backgroundColor: 'rgba(255, 255, 255, 0.9)',
                            titleColor: '#1F2937',
                            bodyColor: '#4B5563',
                            borderColor: '#E5E7EB',
                            borderWidth: 1,
                            padding: 10,
                            boxPadding: 5,
                            usePointStyle: true,
                            callbacks: {
                                label: function(context) {
                                    return `做题数量：${context.raw}道`;
                                }
                            }
                        }
                    },
                    scales: {
                        x: {
                            grid: {
                                display: false
                            }
                        },
                        y: {
                            beginAtZero: true,
                            grid: {
                                color: 'rgba(0, 0, 0, 0.05)'
                            },
                            ticks: {
                                stepSize: 5
                            }
                        }
                    }
                }
            });
        });
    </script>
</body>
</html>
